//
//  MyBranchPartyFootPrintViewController.m
//  ShangHaiHuDongApp
//
//  Created by 刘应平 on 2017/6/13.
//  Copyright © 2017年 刘应平. All rights reserved.
//

#import "MyBranchPartyFootPrintViewController.h"
@interface MyBranchPartyFootPrintViewController ()<UIWebViewDelegate>
/**    */
@property (strong, nonatomic) UITableView  *tableView;
/**  webView  */
@property (strong, nonatomic) UIWebView  *webView;

@end

@implementation MyBranchPartyFootPrintViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.titlelabel.text = self.type;
  
    [self layoutUI];
}

- (void)action_leftButton:(UIButton *)sender{
    if ([self.webView canGoBack]) {
        [self.webView goBack];
    }else{
        if (self.isModel) {
            [self.navigationController dismissViewControllerAnimated:YES completion:nil];
        }else{
            [self.navigationController popViewControllerAnimated:YES];
        }
    }

    
}


- (void)webViewDidFinishLoad:(UIWebView *)webView{
//    NSString *title = [webView stringByEvaluatingJavaScriptFromString:@"document.title"];
//    self.titlelabel.text = title;
    [YJProgressHUD hide];
}
#pragma mark - 界面
- (void)layoutUI{
    
    [self.view addSubview:self.webView];
    [YJProgressHUD showMessage:@"加载中..." duration:10 view:self.view];
    if (self.orangeUrl.length != 0) {
        [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:self.orangeUrl]]];
    }else{
        NSString *urlString = [NSString stringWithFormat:@"%@/upload/html/dyjl/%@.html",HTMLURL,self.accoundId];
        [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:urlString]]];
    }
    
    
    
}



- (UIWebView *)webView{
    if (!_webView) {
        _webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, LP_TopHeight, self.view.width, self.view.height - LP_TopHeight)];
        _webView.delegate = self;
    }
    return _webView;
}



@end
